<extend name="Public:base" />
<block name="header_js">
	<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="__DATA__/editor/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript">
	$(function(){
	    var ue = UE.getEditor('inputContent',{
	        serverUrl :"{:U('Public/editorMethod')}"
	    });
		UE.getEditor('inputWapContent',{
	        serverUrl :"{:U('Public/editorMethod')}"
	    });
        UE.getEditor('inputEnContent',{
            serverUrl :"{:U('Public/editorMethod')}"
        });
        UE.getEditor('inputEnWapContent',{
            serverUrl :"{:U('Public/editorMethod')}"
        });
	})
	</script>
</block>

<block name="content">


	<div class="row row_box">
		<div class="col-lg-12">
			<h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
			{$vo.name}	
		    <span class="xyh-pos">
                <i class="glyphicon glyphicon-log-out"></i>
                <if condition='ACTION_NAME eq "index"'>
                    <foreach name='poscate' item='v'>
                    <a href="{:U('' . ucfirst($v['table_name']) .'/index', array('pid' => $v['id']))}">{$v.name} </a> <em class="glyphicon glyphicon-menu-right"></em> 
                    </foreach>
                </if>
            </span>	    
		    </h3>

            <if condition="$subcate">
            <nav class="navbar navbar-default">
            	<div class="container-fluid">
            		<div class="navbar-header">
            			<span class="navbar-text">子栏目：</span>
            			<foreach name='subcate' item='v'>
				            <a href="{:U(''. ucfirst($v['table_name']) . '/index', array('pid' => $v['id']))}" class="btn btn-sm btn-default navbar-btn">{$v.name}<notempty name="v['child']">&there4;</notempty></a>
				        </foreach>
            		</div>
            	</div>
            </nav>
            </if>
		</div>
		
		
<div class="box_h">

<span class="navbar-text">切换：</span>

	<ul>
		<li class="cnbox"><a href="javascript:volid(0);">中文</a></li>
		<li class="enbox"><a href="javascript:volid(0);">英文</a></li>
	</ul>

</div>			
		
	</div>


	<div class="row">
		<div class="col-lg-12">
			<div class="box">
				<div class="body">
					<form class="form-horizontal" id="formValidate" role="form" method="post" action="{:U('index')}">
                        <!-- CN BOX -->
                        <div class="cn_box">
						
<!--                         <div class="form-group">
                            <label for="inputTtitle" class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-9">
                                <input type="text" name="title" id="inputTtitle" value="{$vo.title}" class="form-control" placeholder="标题" required="required" />
                            </div>
                        </div> -->
						
						
                            <div class="form-group">
                                <label for="inputDescription" class="col-sm-2 control-label">摘要</label>
                                <div class="col-sm-9">
                                    <textarea name="description" id="inputDescription" class="form-control" rows="3" placeholder="请填写摘要">{$vo.description}</textarea>
                                </div>
                            </div>
							
                            <div class="form-group">
                                <label for="inputContent" class="col-sm-2 control-label"><!--内容--></label>
                                <div class="col-sm-9">
                                    <p><span class="pc_content_tab naction">PC端</span> | <span class="wap_content_tab">WAP端</span></p>
                                </div>
                            </div>
                            <div class="form-group pc_content_box">
                                <label for="inputContent" class="col-sm-2 control-label">PC端内容</label>
                                <div class="col-sm-9">
                                    <textarea name="content" id="inputContent" style="height: 370px;">{$vo.content}</textarea>
                                </div>
                            </div>
                            <div class="form-group wap_content_box">
                                <label for="inputWapContent" class="col-sm-2 control-label">WAP端内容</label>
                                <div class="col-sm-9">
                                    <textarea name="wap_content" id="inputWapContent" style="height: 370px;">{$vo.wap_content}</textarea>
                                </div>
                            </div>
                        </div>
                        <!-- / CN BOX -->
                        <!-- EN BOX -->
                        <div class="en_box">
						
<!-- 						                        <div class="form-group">
                            <label for="inputEntitle" class="col-sm-2 control-label">英文标题</label>
                            <div class="col-sm-9">
                                <input type="text" name="en_title" id="inputTtitle" value="{$vo.en_title}" class="form-control" placeholder="标题" required="required" />
                            </div>
                        </div> -->
						
						
                            <div class="form-group">
                                <label for="inputEnDescription" class="col-sm-2 control-label">英文摘要</label>
                                <div class="col-sm-9">
                                    <textarea name="en_description" id="inputEnDescription" class="form-control" rows="3" placeholder="请填写英文摘要">{$vo.en_description}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputContent" class="col-sm-2 control-label"><!--内容--></label>
                                <div class="col-sm-9">
                                    <p><span class="en_pc_content_tab naction">PC端</span> | <span class="en_wap_content_tab">WAP端</span></p>
                                </div>
                            </div>
                            <div class="form-group en_pc_content_box">
                                <label for="inputEnContent" class="col-sm-2 control-label">PC端英文内容</label>
                                <div class="col-sm-9">
                                    <textarea name="en_content" id="inputEnContent" style="height: 370px;">{$vo.en_content}</textarea>
                                </div>
                            </div>
                            <div class="form-group en_wap_content_box">
                                <label for="inputEnWapContent" class="col-sm-2 control-label">WAP端英文内容</label>
                                <div class="col-sm-9">
                                    <textarea name="en_wap_content" id="inputEnWapContent" style="height: 370px;">{$vo.en_wap_content}</textarea>
                                </div>
                            </div>
                        </div>
                        <!-- / EN BOX -->
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-9">
								<input type="hidden" name="id" value="{$pid}" />
								<input type="hidden" name="pid" value="{$pid}" />
								<div class="btn-group">
									<button type="submit" class="btn btn-primary"> <i class="glyphicon glyphicon-saved"></i>
										保存
									</button>
								</div>
							</div>
						</div>
					</form>

				</div>
			</div>
		</div>
	</div>
</block>
<block name="out_foot">
    <script>
        $(function(){
            /*编辑器TAB*/
            $('.en_box').hide();
            $('.cnbox').addClass('hover'); //默认给中文加hover
            $('.enbox').click(function () {
                $('.cn_box').hide();
                $('.en_box').show();
                //下面两句是加hover
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');
            });
            $('.cnbox').click(function () {
                $('.cn_box').show();
                $('.en_box').hide();
                //下面两句是加hover
                $(this).parent('ul').find('li').removeClass('hover');
                $(this).addClass('hover');
            });
            //
            $('.wap_content_box').css('display','none');
            $('.wap_content_tab').on('click',function(){
                $('.wap_content_box').show();
                $('.pc_content_box').hide();
                $('.wap_content_tab').addClass('naction');
                $('.pc_content_tab').removeClass('naction');
            });
            $('.pc_content_tab').on('click',function(){
                $('.pc_content_box').show();
                $('.wap_content_box').hide();
                $('.pc_content_tab').addClass('naction');
                $('.wap_content_tab').removeClass('naction');
            });
            //
            $('.en_wap_content_box').css('display','none');
            $('.en_wap_content_tab').on('click',function(){
                $('.en_wap_content_box').show();
                $('.en_pc_content_box').hide();
                $('.en_wap_content_tab').addClass('naction');
                $('.en_pc_content_tab').removeClass('naction');
            });
            $('.en_pc_content_tab').on('click',function(){
                $('.en_pc_content_box').show();
                $('.en_wap_content_box').hide();
                $('.en_pc_content_tab').addClass('naction');
                $('.en_wap_content_tab').removeClass('naction');
            });
        })
    </script>
</block>
